﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using funktionsplotter.contracts;

namespace funktionsplotter.app.dummy
{
    class X_Werte_generieren : IX_Werte_generieren
    {
        public IEnumerable<double> Process(Tuple<double, double, int> daten)
        {
            Trace.TraceInformation("X Werte generieren: {0}..{1}, {2}", daten.Item1, daten.Item2, daten.Item3);
            double dx = (daten.Item2 - daten.Item1)/daten.Item3;
            Trace.TraceInformation("  dx: {0}", dx);
            for (var i = 0; i < daten.Item3; i++)
            {
                double x = daten.Item1 + i*dx;
                Trace.TraceInformation("  x: {0}", x);
                yield return x;
            }
        }
    }
}